home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / showdevs.zip / SHOWDEVS.C < prev    next >
C/C++ Source or Header  |  1989-03-12  |  889b  |  41 lines

  1.  
  2. #include <dos.h>  /* only required if you use the C version of get_lol() */
  3.  
  4. typedef unsigned char far *charptr;
  5.  
  6. charptr get_lol();
  7.  
  8. struct {  /* store all data as simple types: */
  9.   union { long next; int endflag; } u;
  10.   int attrib;
  11.   unsigned int strat,intrp;
  12.   char dname[9];
  13. } dhdr;
  14.  
  15. main()
  16. {
  17.   charptr d;
  18.   d=get_lol();  /* get MS-DOS List of Lists */
  19.   d+=0x22;
  20.  
  21.   printf("\nAddress    Name      attrib  strat  intrp\n\n");
  22.   while (dhdr.u.endflag != -1)
  23.   {
  24.     copy18((char *)(&dhdr),d);
  25.     printf("%Fp  ",d);
  26.     if (dhdr.attrib & 0x8000)  printf("%-9s",        dhdr.dname    );
  27.     else                       printf("(%1d units)", dhdr.dname[0] );
  28.     printf(" %04X    %Np   %Np\n", dhdr.attrib, dhdr.strat, dhdr.intrp);
  29.     d=(charptr)dhdr.u.next;
  30.   }
  31. }
  32.  
  33. copy18( char *d, charptr s )
  34. {
  35.   int i;
  36.   for (i=0;i<18;++i)
  37.     d[i]=s[i];
  38. }
  39.  
  40.  
  41.